from plyny.table import DataTable


if __name__ == '__main__':
    from easyconfig import Config
    c = Config()

    with c.parser() as p:
        p.add_option('workstream', alias='k', multiple=True, unspecified_default=True, required=True)

    dt = c.workstreams().open(workstream)
    x = [i for i, value in enumerate(dt.types()) if value in (int, float)]
    t = DataTable(*(dt.column_names[i] for i in x))
    t.add(*dt.sum(*x))
    t.add(*dt.mean(*x))

    print t.table()
